const {
    resolve
} = require("path");
const {
    rejects
} = require("assert");
const {
    fstat
} = require("fs");

function readFile(path) {
    return new Promise((resolve, rejects) => {
        fstat.readFile(path, function (error, data) {
            if (error) {
                console.log(error)
                rejects(error)
            } else {
                console.log(data);
                resolve(data)
            }
        })
    })
}